﻿USE [master]
GO
/****** Object:  Database [DLM]    Script Date: 05/04/2012 10:24:11 ******/
CREATE DATABASE [DLM] ON  PRIMARY 
( NAME = N'DLM', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DLM.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'DLM_log', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DLM_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [DLM].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [DLM] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [DLM] SET ANSI_NULLS OFF
GO
ALTER DATABASE [DLM] SET ANSI_PADDING OFF
GO
ALTER DATABASE [DLM] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [DLM] SET ARITHABORT OFF
GO
ALTER DATABASE [DLM] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [DLM] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [DLM] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [DLM] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [DLM] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [DLM] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [DLM] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [DLM] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [DLM] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [DLM] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [DLM] SET  DISABLE_BROKER
GO
ALTER DATABASE [DLM] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [DLM] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [DLM] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [DLM] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [DLM] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [DLM] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [DLM] SET  READ_WRITE
GO
ALTER DATABASE [DLM] SET RECOVERY FULL
GO
ALTER DATABASE [DLM] SET  MULTI_USER
GO
ALTER DATABASE [DLM] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [DLM] SET DB_CHAINING OFF
GO
EXEC sys.sp_db_vardecimal_storage_format N'DLM', N'ON'
GO
USE [DLM]
GO
/****** Object:  Table [dbo].[Party]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Party](
	[PartyID] [int] IDENTITY(1,1) NOT NULL,
	[Status] [int] NOT NULL,
	[PartyType] [int] NOT NULL,
	[Subject] [nvarchar](30) NOT NULL,
	[PhotoUrl] [nvarchar](20) NULL,
	[Modality] [nvarchar](20) NULL,
	[PartyDate] [datetime] NULL,
	[Location] [nvarchar](100) NULL,
	[Address] [nvarchar](150) NULL,
	[MemberCount] [int] NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Party] PRIMARY KEY CLUSTERED 
(
	[PartyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Party] ON
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [MemberCount], [CreateDate]) VALUES (1, 0, 1, N'wwwwwwwwww', N'2', N'2', CAST(0x00009FEB00000000 AS DateTime), N'上海,浦东,张江', N'2', 2, CAST(0x0000A03F0119F96B AS DateTime))
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [MemberCount], [CreateDate]) VALUES (2, 0, 2, N'11', N'11', N'11', CAST(0x00009FEB00000000 AS DateTime), N'22', N'22', 2, CAST(0x0000A041011225F4 AS DateTime))
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [MemberCount], [CreateDate]) VALUES (3, 4, 0, N'3eeeee', N'22222', N'ee', CAST(0x00009FEB00000000 AS DateTime), N'2012/2/2', N'222222', 222, CAST(0x0000A04300F73263 AS DateTime))
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [MemberCount], [CreateDate]) VALUES (4, 0, 3, N'fffffff', N'1', N'22', CAST(0x00009FEB00000000 AS DateTime), N'2222', N'222', 22, CAST(0x0000A04500B72C0F AS DateTime))
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [MemberCount], [CreateDate]) VALUES (5, 0, 0, N'ttttt', NULL, N'tt', CAST(0x00009FEB00000000 AS DateTime), N'2', N'2', 2, CAST(0x0000A04601011689 AS DateTime))
SET IDENTITY_INSERT [dbo].[Party] OFF
/****** Object:  Table [dbo].[Notice]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Notice](
	[NoticeID] [int] IDENTITY(1,1) NOT NULL,
	[Subject] [nvarchar](20) NOT NULL,
	[Content] [ntext] NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Notice] PRIMARY KEY CLUSTERED 
(
	[NoticeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Remark]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Remark](
	[RemarkID] [int] IDENTITY(1,1) NOT NULL,
	[PartyID] [int] NOT NULL,
	[Content] [nvarchar](100) NULL,
	[UserID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Remark] PRIMARY KEY CLUSTERED 
(
	[RemarkID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[AdminUser]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdminUser](
	[AdminID] [int] IDENTITY(1,1) NOT NULL,
	[Administrator] [nvarchar](30) NOT NULL,
	[Password] [varchar](20) NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_AdminUser] PRIMARY KEY CLUSTERED 
(
	[AdminID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[AdminLog]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdminLog](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[Action] [nvarchar](20) NOT NULL,
	[ActionDate] [datetime] NOT NULL,
	[ActionSourceIP] [varchar](20) NULL,
 CONSTRAINT [PK_AdminLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Account]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Account](
	[AccountID] [int] IDENTITY(1,1) NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[Password] [varchar](30) NOT NULL,
	[Email] [varchar](30) NOT NULL,
	[ActiveCode] [varchar](50) NOT NULL,
	[IsActive] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Account] ON
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (1, N'ww', N'111', N'oyjd614@163.com', N'46c73b8c-4cd7-43ab-821e-b3c8bf73dbfa', 1, CAST(0x0000A03F010C4B2C AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (2, N'ccx', N'111', N'oyjd614@163.com', N'd15598cf-bd2e-46d3-a983-db63cfbbaa97', 1, CAST(0x0000A03F011526A7 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (3, N'www', N'111', N'oyjd614@163.com', N'd3f6fc6f-d633-4623-a129-fac5900b202d', 0, CAST(0x0000A03F0172068C AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (4, N'tt', N'111', N'oyjd614@163.com', N'7dadb99a-cc27-4baa-b900-8c0b771de85b', 0, CAST(0x0000A04500BA5BEF AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (5, N'tt', N'111', N'oyjd614@163.com', N'c1735c1b-0822-4bfb-8bc3-8fe8e1860a41', 0, CAST(0x0000A04501010DF6 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (6, N'yy', N'111', N'oyjd614@163.com', N'bfba144f-037e-44ea-a1d4-fa138a65e8e5', 0, CAST(0x0000A04501024B5F AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (7, N'hh', N'111', N'oyjd614@163.com', N'597fd955-529a-4d00-a276-6d83cf9585ea', 0, CAST(0x0000A045010C5075 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (8, N'vvv', N'111', N'oyjd614@163.com', N'd22cb02d-6887-4fd1-bc24-aae8ee4dd62a', 0, CAST(0x0000A045010D1C36 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (9, N'jj', N'111', N'oyjd614@163.com', N'e1430669-b9b1-4ea1-8e4d-16bb9c315c6d', 0, CAST(0x0000A04501108C53 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (10, N'gg', N'111', N'oyjd614@163.com', N'2ddff32a-5f1a-457e-be4a-93a811bef4bd', 0, CAST(0x0000A04501127E13 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (11, N'gg', N'111', N'oyjd614@163.com', N'bcba727c-b4fc-49ae-b139-81f5d76962e4', 1, CAST(0x0000A0450112BAD2 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (12, N'ss', N'111', N'oyjd614@163.com', N'3a377ea3-03c5-4ae3-8bd6-1eff663ece4b', 1, CAST(0x0000A04501145D71 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [CreateDate]) VALUES (13, N'nn', N'111', N'oyjd614@163.com', N'22ee51bd-e20a-4353-9558-1720e1bd983a', 0, CAST(0x0000A0450117E5BE AS DateTime))
SET IDENTITY_INSERT [dbo].[Account] OFF
/****** Object:  Table [dbo].[EmailInvitation]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EmailInvitation](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[UserID] [int] NOT NULL,
	[Email] [varchar](25) NOT NULL,
	[Content] [ntext] NULL,
	[PartyID] [int] NOT NULL,
	[PartySubject] [nvarchar](30) NULL,
	[IsSent] [bit] NOT NULL,
	[SendDate] [datetime] NOT NULL,
 CONSTRAINT [PK_EmailInvitation] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Country]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Country](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Country] [nvarchar](15) NULL,
	[Province] [nvarchar](15) NULL,
	[City] [nvarchar](10) NULL,
	[Zone] [nvarchar](10) NULL,
	[ParentId] [int] NULL,
 CONSTRAINT [PK_Country] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Log]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Log](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[Date] [datetime] NOT NULL,
	[Level] [varchar](50) NULL,
	[Logger] [varchar](255) NULL,
	[Source] [nvarchar](255) NULL,
	[Message] [nvarchar](255) NULL,
 CONSTRAINT [PK_SystemLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[User]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[AccountID] [int] NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[Name] [nvarchar](20) NULL,
	[Gender] [bit] NULL,
	[Birthday] [datetime] NULL,
	[Age] [smallint] NULL,
	[Location] [nvarchar](20) NULL,
	[HomePlace] [nvarchar](30) NULL,
	[Marriage] [bit] NULL,
	[NativePlace] [nvarchar](40) NULL,
	[Stature] [nvarchar](10) NULL,
	[Weight] [int] NULL,
	[Education] [nvarchar](10) NULL,
	[Job] [nvarchar](20) NULL,
	[Income] [decimal](10, 2) NULL,
	[Position] [nvarchar](20) NULL,
	[Industry] [nvarchar](50) NULL,
	[Car] [bit] NULL,
	[Parents] [nvarchar](20) NULL,
	[Photo] [nvarchar](50) NULL,
	[Phone] [varchar](15) NULL,
	[IM] [varchar](18) NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UQ_User_AccountID] UNIQUE NONCLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[User] ON
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (1, 1, N'ww', N'魏伟', 1, CAST(0x00009FEB00000000 AS DateTime), 22, NULL, N'1', 1, N'新疆', N'170', 60, N'大学', N'IT行业', CAST(1000.00 AS Decimal(10, 2)), N'工程师', NULL, 1, N'很好', N'ww/kkx.jpg', NULL, NULL, CAST(0x0000A03F010C4A6C AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (2, 2, N'ccx', NULL, 1, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'test', NULL, NULL, CAST(0x0000A03F011526A7 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (3, 3, N'www', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'test', NULL, NULL, CAST(0x0000A03F0172068C AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (4, 4, N'tt', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'test', NULL, NULL, CAST(0x0000A04500BA5BEF AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (5, 5, N'tt', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'test', NULL, NULL, CAST(0x0000A04501010DF6 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (6, 6, N'yy', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000A04501024DA9 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (7, 7, N'hh', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000A045010C522C AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (8, 8, N'vvv', NULL, 1, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000A045010D1C37 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (9, 9, N'jj', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000A04501108C53 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (10, 10, N'gg', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000A04501127E13 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (11, 11, N'gg', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000A0450112BAD2 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (12, 12, N'ss', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000A04501145D71 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [CreateDate]) VALUES (13, 13, N'nn', NULL, 0, CAST(0x00009FEB00000000 AS DateTime), 22, N'11', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, CAST(0x0000A0450117E5BE AS DateTime))
SET IDENTITY_INSERT [dbo].[User] OFF
/****** Object:  Table [dbo].[UserView]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UserView](
	[ViewID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[IP] [varchar](20) NULL,
	[ViewDate] [datetime] NOT NULL,
 CONSTRAINT [PK_UserView] PRIMARY KEY CLUSTERED 
(
	[ViewID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[UserPartyAssociation]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserPartyAssociation](
	[UPAID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[IsLead] [bigint] NULL,
 CONSTRAINT [PK_UserPartyAssociation] PRIMARY KEY CLUSTERED 
(
	[UPAID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[UserPartyAssociation] ON
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead]) VALUES (1, 1, 1, 1)
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead]) VALUES (3, 1, 2, 1)
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead]) VALUES (4, 1, 3, 1)
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead]) VALUES (7, 2, 4, 1)
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead]) VALUES (8, 1, 5, 1)
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead]) VALUES (9, 1, 4, 0)
SET IDENTITY_INSERT [dbo].[UserPartyAssociation] OFF
/****** Object:  Table [dbo].[Photo]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Photo](
	[PhotoID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Url] [nvarchar](30) NULL,
	[Desc] [nvarchar](20) NULL,
	[IsMain] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Photo] PRIMARY KEY CLUSTERED 
(
	[PhotoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Photo] ON
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (2, 1, N'ww/index_01-1.jpg', N'test', 0, CAST(0x0000A04100D4AD44 AS DateTime))
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (3, 1, N'ww/kkx.jpg', N'test', 0, CAST(0x0000A04600F6B37E AS DateTime))
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (4, 1, N'ww/wbpluto_155813.jpg', N'test', 0, CAST(0x0000A04600F6CE48 AS DateTime))
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (5, 1, N'ww/1151499_17.jpg', N'test', 0, CAST(0x0000A04600F8CC36 AS DateTime))
SET IDENTITY_INSERT [dbo].[Photo] OFF
/****** Object:  Table [dbo].[Message]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Message](
	[MessageID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Title] [nvarchar](20) NOT NULL,
	[Content] [ntext] NULL,
	[IsRead] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Message] PRIMARY KEY CLUSTERED 
(
	[MessageID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Invitation]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Invitation](
	[InvitationID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
	[InviteDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Invitation] PRIMARY KEY CLUSTERED 
(
	[InvitationID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Friend]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Friend](
	[FriendID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[MyFriendID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
 CONSTRAINT [PK_Friend] PRIMARY KEY CLUSTERED 
(
	[FriendID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Friend] ON
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (1, 1, 2, CAST(0x0000A03F017690C8 AS DateTime), 1)
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (2, 2, 1, CAST(0x0000A0460108B897 AS DateTime), 1)
SET IDENTITY_INSERT [dbo].[Friend] OFF
/****** Object:  Table [dbo].[Bonus]    Script Date: 05/04/2012 10:24:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Bonus](
	[BonusID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Bonus] [decimal](10, 2) NULL,
 CONSTRAINT [PK_Bonus] PRIMARY KEY CLUSTERED 
(
	[BonusID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UQ_Bonus_UserID] UNIQUE NONCLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  ForeignKey [FK_User_Account]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[User]  WITH CHECK ADD  CONSTRAINT [FK_User_Account] FOREIGN KEY([AccountID])
REFERENCES [dbo].[Account] ([AccountID])
GO
ALTER TABLE [dbo].[User] CHECK CONSTRAINT [FK_User_Account]
GO
/****** Object:  ForeignKey [FK_UserView_User]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[UserView]  WITH CHECK ADD  CONSTRAINT [FK_UserView_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[UserView] CHECK CONSTRAINT [FK_UserView_User]
GO
/****** Object:  ForeignKey [FK_UserPartyAssociation_Party]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[UserPartyAssociation]  WITH CHECK ADD  CONSTRAINT [FK_UserPartyAssociation_Party] FOREIGN KEY([PartyID])
REFERENCES [dbo].[Party] ([PartyID])
GO
ALTER TABLE [dbo].[UserPartyAssociation] CHECK CONSTRAINT [FK_UserPartyAssociation_Party]
GO
/****** Object:  ForeignKey [FK_UserPartyAssociation_User]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[UserPartyAssociation]  WITH CHECK ADD  CONSTRAINT [FK_UserPartyAssociation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[UserPartyAssociation] CHECK CONSTRAINT [FK_UserPartyAssociation_User]
GO
/****** Object:  ForeignKey [FK_Photo_User]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[Photo]  WITH CHECK ADD  CONSTRAINT [FK_Photo_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Photo] CHECK CONSTRAINT [FK_Photo_User]
GO
/****** Object:  ForeignKey [FK_Message_User]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[Message]  WITH CHECK ADD  CONSTRAINT [FK_Message_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Message] CHECK CONSTRAINT [FK_Message_User]
GO
/****** Object:  ForeignKey [FK_Invitation_User]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[Invitation]  WITH CHECK ADD  CONSTRAINT [FK_Invitation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Invitation] CHECK CONSTRAINT [FK_Invitation_User]
GO
/****** Object:  ForeignKey [FK_Friend_User]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[Friend]  WITH CHECK ADD  CONSTRAINT [FK_Friend_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Friend] CHECK CONSTRAINT [FK_Friend_User]
GO
/****** Object:  ForeignKey [FK_Bonus_User]    Script Date: 05/04/2012 10:24:12 ******/
ALTER TABLE [dbo].[Bonus]  WITH CHECK ADD  CONSTRAINT [FK_Bonus_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Bonus] CHECK CONSTRAINT [FK_Bonus_User]
GO
